@extends('layouts.home')
@section('content')
    <main class="r_box">
        @if(!empty($tag))
            <h1 class="news_title">拥有<span style="color: red">{{$tag->name}}</span>标签的文章</h1>
        @endif

        @if(!empty($category))
            <h1 class="news_title"><span style="color: red">{{$category->name}}</span>分类下的文章</h1>
        @endif

        @if(!empty($keywords))
            <h1 class="news_title">搜索到与<span style="color: red">{{$keywords}}</span>相关的文章</h1>
        @endif

        @foreach($articles as $k=>$v)
                <li>
                    <a href="{{url('home/index/article',$v->id)}}">
                        <i><img src="{{$v->cover}}"></i>
                        <h3>{{$v->title}}</h3>
                        <p>{{$v->description}}</p>
                    </a>
                </li>
        @endforeach

        {{$articles->appends(['keywords' => request()->input('keywords')])->links('vendor.pagination.wcx')}}
    </main>
@stop